{include /common/header}
<div class="row">
	<div class="col-sm-5 col-md-3 col-lg-3">
		{include side}
	</div>
	<div class="col-sm-7 col-md-9 col-lg-9">
		<p>
			<form class="form-inline" action="{:url('/home/content/search')}" method="GET">
				<div class="form-group">
					<label class="sr-only">关键词</label>
					<input type="text" name="q" value="{$q}" autocomplete="off" class="form-control" placeholder="关键词">
				</div>
				<button type="submit" class="btn btn-danger">搜索</button>
			</form>
		</p>
		{if $q}
			<div class="panel panel-default">
				<div class="panel-heading">"<span class="text-danger">{$q}</span>" 的搜索结果</div>
				<ul class="list-group">
					{if $channels}
					{foreach $channels as $v}
					<li class="list-group-item"><span style="color: #444;">•</span>&nbsp;<a href="{:url('/home/content/index', ['id'=>$v['id']])}">{:str_replace($q,'<span style="color:red;">'.$q.'</span>', $v['title'])}</a></li>
					{/foreach}
					{/if}
					{foreach $contents as $v}
					<li class="list-group-item"><span style="color: #444;">•</span>&nbsp;<a href="{:content_url($v)}">{:str_replace($q,'<span style="color:red;">'.$q.'</span>', $v['title'])}</a></li>
					{/foreach}
				</ul>
			</div>
			<nav>
				<ul class="pagination">
					{foreach $pages as $v}
						{if isset($v['disable'])}
							<li class="disabled"><a href="javascript:void(0);">{$v.text}</a></li>
						{elseif isset($v['current'])}
							<li class="active"><a href="javascript:void(0);">{$v.text}</a></li>
						{else}
							<li><a href="{:url('/home/content/search')}?q={$q}&page={$v.page}">{$v.text}</a></li>
						{/if}
					{/foreach}
				</ul>
			</nav>
		{/if}
	</div>
</div>
{include /common/footer}